Skip to content

fix: allow a Reply-To email on any domain - #591

Open
mikkelsvartveit wants to merge 2 commits into
useplunk:nextfrom
mikkelsvartveit:fix/reply-to-any-domain
Open

mikkelsvartveit wants to merge 2 commits into
useplunk:nextfrom
mikkelsvartveit:fix/reply-to-any-domain

Conversation

@mikkelsvartveit

Copy link
Copy Markdown
Contributor

Description

The Reply-To field on templates and campaigns reused EmailDomainInput, the same input as the From field. That input only lets you pick a verified domain from a dropdown, so you can't set a Reply-To address on another domain, such as a support inbox or a shared helpdesk address.

Only the From address needs a verified domain: DomainService.verifyEmailDomain only checks from, and /v1/send already accepts any reply address. So this was a dashboard-only limitation.

Dashboard (EmailSettings.tsx): the Reply-To field is now a plain type="email" input.

  • The placeholder shows the full From address, since Reply-To falls back to it, instead of only the part before the @.
  • Help text below the field, matching the From name field: "Where replies are sent. Can be on any domain. Defaults to the From email if not set."
  • The From field is unchanged and still restricted to verified domains.

API: with free text, a typo could now be saved. The browser's email validation only runs on the form's submit button, while the floating StickySaveBar calls handleSave directly. So the server now checks it:

  • New assertValidReplyTo in utils/templateValidation.ts, next to assertValidTemplateSyntax. It returns 400 "Reply-To must be a valid email address" for a non-empty value that isn't an email address.
  • It's called in template create, template update and campaign update, right after the existing from domain check.
  • Campaign create already rejects it through CampaignSchemas.create.
  • Empty and null values are still allowed, so existing API clients that send an empty Reply-To keep working.

Type of Change

  • feat: New feature (MINOR version bump)
  • fix: Bug fix (PATCH version bump)
  • feat!: Breaking change - new feature (MAJOR version bump)
  • fix!: Breaking change - bug fix (MAJOR version bump)
  • docs: Documentation update (no version bump)
  • chore: Maintenance/dependencies (no version bump)
  • refactor: Code refactoring (no version bump)
  • test: Adding tests (no version bump)
  • perf: Performance improvement (PATCH version bump)

Testing

Run locally against Postgres 16, Redis 7 and MinIO, with the same environment as ci.yml:

  • yarn test:run: 80 files, 1683 tests pass, including 4 new assertValidReplyTo tests
  • yarn lint: 0 errors, and no new warnings
  • yarn build --filter=api --filter=web succeeds, and tsc --noEmit passes for api and web

Manually, with the API and dashboard dev servers and a project with a verified domain:

  • Created a template with From hello@<verified domain> and Reply-To support@other-domain.example. It saved, and the edit page shows the address after a reload.
  • On the edit page, the floating save bar with Reply-To still-not-an-email shows "Reply-To must be a valid email address" and doesn't save.
  • A valid address on another domain saves. Clearing the field saves null, and the placeholder shows the From address.
  • Campaigns, through the API with a dashboard session: create with a Reply-To on another domain returns 201, update to an invalid address returns 400, and updating to a valid address or null returns 200. The campaign edit page shows the new field with the saved address.

Checklist

  • PR title follows conventional commits format
  • Code builds successfully
  • Tests pass locally
  • Documentation updated (if needed)

Related Issues

Related to #228, which asked for a configurable Reply-To in the UI.

mikkelsvartveit and others added 2 commits November 13, 2026 21:50
The Reply-To field reused the From field's input, which only offers
verified domains. Only the From address needs a verified domain, and
the API already accepts any Reply-To address, so use a plain email input.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The dashboard now takes Reply-To as free text, and its floating save bar
skips the browser's form validation, so check the address on the server.
Template create and update and campaign update now return 400 for a
Reply-To that is not an email address. Empty values are still allowed.
Campaign create already validates it through CampaignSchemas.create.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant